﻿<UserControls:ScrumUserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:Controls="clr-namespace:Microsoft.Surface.Presentation.Controls;assembly=Microsoft.Surface.Presentation"
    xmlns:CustomControl1="clr-namespace:ScrumTable.UI.View.CustomControl;assembly=ScrumTable.UI.View" 
    xmlns:Localization="clr-namespace:ScrumTable.UI.View.Localization;assembly=ScrumTable.UI.View" xmlns:UserControl="clr-namespace:ScrumTable.UI.View.Controls;assembly=ScrumTable.UI.View" xmlns:UserControls="clr-namespace:ScrumTable.UI.View.WinTouch.UserControls" xmlns:Converter="clr-namespace:ScrumTable.UI.View.Converter;assembly=ScrumTable.UI.View" xmlns:Interop2="clr-namespace:ScrumTable.UI.View.WinTouch.Win32Interopt"   xmlns:forms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms" xmlns:Interop="clr-namespace:ScrumTable.UI.View.WinTouch.Win32Interopt.Interop" xmlns:Tool="clr-namespace:ScrumTable.UI.View.WinTouch.UserControls.Tool" xmlns:Tools="clr-namespace:ScrumTable.UI.ViewModel.Tools;assembly=ScrumTable.UI.ViewModel" x:Class="ScrumTable.UI.View.WinTouch.UserControls.Tool.ReportControl"	x:Name="UserControl" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="White">
    <UserControls:ScrumUserControl.Resources> 
        
        <DataTemplate x:Key="TempleteNoReport">
            <Controls:SurfaceButton Click="OnSelectClick" HorizontalAlignment="Center" VerticalAlignment="Center">
                <Label Background="{StaticResource IconBurnDown}" Width="55" Height="55"/>
            </Controls:SurfaceButton>
        </DataTemplate>
        <DataTemplate x:Key="TempleteHasReport">
            <Grid VerticalAlignment="Stretch">
                <CustomControl1:WebAsyncImage WebPostWebPair="{Binding  SelectedReportPair}" ClipWhiteBorderRightBottom="True" Background="White"  x:Name="AsyncImage" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" TouchDown="OnReportClicked"  MouseDown="OnReportClicked"></CustomControl1:WebAsyncImage>
                <Controls:SurfaceButton HorizontalAlignment="Right" VerticalAlignment="Top" Click="OnDeleteClick">
                    <Label Background="{StaticResource IconClose}" Width="45" Height="45"/>
                </Controls:SurfaceButton>
            </Grid>
        </DataTemplate>        
    </UserControls:ScrumUserControl.Resources>
    <Grid>
        <ContentControl  Content="{Binding}">
            <ContentControl.ContentTemplate>
                <DataTemplate>                    
                    <ContentControl Name="cc" Content="{Binding}" ContentTemplate="{StaticResource TempleteNoReport}" />                    
                    <DataTemplate.Triggers>
                        <DataTrigger Binding="{Binding Path=HasReport}" Value="NotSelected">
                            <Setter TargetName="cc"  Property="ContentTemplate"    Value="{StaticResource TempleteNoReport}" />
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Path=HasReport}" Value="Selected">
                            <Setter TargetName="cc"  Property="ContentTemplate"    Value="{StaticResource TempleteHasReport}" />
                        </DataTrigger>
                    </DataTemplate.Triggers>
                </DataTemplate>
            </ContentControl.ContentTemplate>
        </ContentControl>    
    </Grid>
</UserControls:ScrumUserControl>    